<?php

declare(strict_types=1);

namespace app\model;

use think\model\concern\SoftDelete;
use app\model\common\BaseModel;
use app\model\common\HasPswdTrait;
use app\model\common\LoginCacheTrait;

/**
 * 商品
 */
class Goods extends BaseModel
{
    public static $modelAlias = '商品';

    protected $table = 'goods';
    protected $pk = 'id';

    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;

    protected $json = ['banner_imgs', 'tags'];
    protected $jsonAssoc = true;

    protected $hidden = [];

    public function GoodsType()
    {
        return $this->belongsTo(GoodsType::class, 'type_id', 'id');
    }
}
